# -*- coding = utf-8
#@[Time] : 2021/3/31 21:22
#@Auther : xiahuaS
#@File : E-1.py
#@Software : PyCharm

#入门级JS

import requests,time,base64

class e_1():
    def __init__(self):
        values = []
        self.values = values

    def get_m(self,index):
        m = base64.b64encode(('yuanrenxue' + str(index)).encode("latin1")).decode("utf8")
        return m

    def get_values(self,index,m):
        url = 'http://match.yuanrenxue.com/api/match/12?page=' + f'{index}' + '&m=' + str(m) + '%3D'
        headers = {
            'Cookie': 'sessionid=pgubv7p05kqvu88r6v6jz0j1mzogtjtf',
        }
        resp = requests.get(url,headers = headers)
        html = resp.content.decode('utf8')
        html = eval(html)
        for i in range(len(html['data'])):
            value = html['data'][i]['value']
            self.values.append(value)

    def main(self):
        for index in range(1,6):
            m = self.get_m(index)
            self.get_values(index,m)
            time.sleep(0.5)
        print(sum(self.values))

e_1().main()